import request from '@util/request'

/**
 * 查询日程列表
 * @param param
 * @returns {*}
 */
export const queryScheduleList = (param) => {
    return request.post('api/v1/schedule/scheduleListQuery', param);
}
/**
 * 增加API 展示更多的时候使用
 * @param param
 * @returns {*}
 */
export const scheduleMoreQuery = (param) => {
    return request.post('api/v1/schedule/scheduleMoreQuery', param);
}
/**
 * 材料feedback接口 Header 加上认证token
 * @param param
 * @returns {*}
 */
export const schedulefeedback = (param) => {
    return request.post('api/v1/schedule/suggest/feedback', param);
}


/**
 * 更新日程状态
 * @param param
 * @returns {*}
 */
export const scheduleStatusUpdate = (param) => {
    return request.post(`api/v1/schedule/scheduleStatusUpdate/${param.id}?status=${param.status}`)
}

/**
 * 更新日程置顶
 * @param param
 * @returns {*}
 */
export const scheduleTopUpdate = (param) => {
    return request.post(`api/v1/schedule/scheduleTopUpdate/${param.id}?isTop=${param.isTop}`)
}
/**
 * 日程类型查询
 * @param param
 * @returns {*}
 */
export const scheduleDimensionTypeQuery = () => {
    return request.get(`api/v1/schedule/scheduleDimensionTypeMapQuery?bu=${sessionStorage.getItem('bu').replace('&/g', '并且')}`)
}
/**
 * 查询日程的状态
 * @param param
 * @returns {*}
 */
export const scheduleDimensionStatusQuery = () => {
    return request.get(`api/v1/schedule/scheduleDimensionStatusQuery?module=日程&paraGroup=日程查询&paraName=日程状态`)
}
/**
 * 查询/获取日程详细页面信息
 * @param param
 * @returns {*}
 */
export const scheduleDetailQuery = (id) => {
    return request.get(`api/v1/schedule/scheduleDetailQuery/${id}`)
}
/**
 * 查询/获取日程详细页面信息
 * @param param
 * @returns {*}
 */
export const scheduleDetailUpdate = (param) => {
    return request.post(`api/v1/schedule/scheduleDetailUpdate/${param.id}`, param)
}
/**
 * 添加新日程
 * @param param
 * @returns {*}
 */
export const scheduleDetailCreate = (param) => {
    return request.post(`api/v1/schedule/scheduleDetailCreate`, param)
}
/**
 * 查询拜访人列表
 * @param param
 * @returns {*}
 */
export const scheduleDimensionDoctorQuery = () => {
    return request.post(`api/v1/schedule/scheduleDimensionDoctorQuery`)
}
/**
 * 通过Email获取token
 * @param param
 * @returns {*}
 */
export const getToken = (param) => {
    return request.post(`oauth/email/token`, param)
}
/**
 * 我的客户-按认证tab查询
 * @param param
 * @returns {*}
 */
export const getCertificationTabList = (param) => {
    return request.post(`api/v1/customer/certificationListQuery`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 * 我的客户-按医院tab查询
 * @param param
 * @returns {*}
 */
export const getHospitalTabList = (param) => {
    return request.post(`api/v1/customer/hospitalListQuery`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 * 我的客户-按医科室Tab查询
 * @param param
 * @returns {*}
 */
export const getDeptTabList = (param) => {
    return request.post(`api/v1/customer/departmentListQuery`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 * 我的客户-按医科室Tab查询
 * @param param
 * @returns {*}
 */
export const getSurnameTabList = (param) => {
    return request.post(`api/v1/customer/surnameListQuery`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 *代表report
 * @param param
 * @returns {*}
 */
export const DaibiaiReport = (param) => {
    return request.get(`api/v1/schedule/daibiao/report`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 *代表430
 * @param param
 * @returns {*}
 */
export const get430 = (param) => {
    return request.get(`api/v1/schedule/daibiao/report/430`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 *DM430
 * @param param
 * @returns {*}
 */
export const getdm430 = (param) => {
    return request.get(`api/v1/schedule/dm/report/430`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 *DM report
 * @param param
 * @returns {*}
 */
export const dmReport = (param) => {
    return request.get(`api/v1/schedule/dm/report`, Object.assign({email: sessionStorage.getItem('email')}, param))
}
/**
 *DM_group daily
 * @param param
 * @returns {*}
 */
export const dmDaily = (param) => {
    return request.get(`api/v1/schedule/dm/report/daily`, param)
}
/**
 *DM_group team
 * @param param
 * @returns {*}
 */
export const dmTeam = (param) => {
    return request.get(`api/v1/schedule/dm/report/team`, param)
}
/**
 *DM_group doctor
 * @param param
 * @returns {*}
 */
export const dmDoctor = (param) => {
    return request.get(`api/v1/schedule/dm/report/team/wx/doctor`, param)
}
/**
 *DM_pie
 * @param param
 * @returns {*}
 */
export const dmPie = (param) => {
    return request.get(`/api/v1/schedule/dm/report/completion`, param)
}
/**
 *根据hcpid获取etmsccode
 * @param param
 * @returns {*}
 */
export const getEtmscode = (hcpid,email) => {
    return request.get(`/api/v1/schedule/getHcpByHcpId?hcpId=${hcpid}&email=${email}`)
}

/**
 * hcp明细获取
 * @param param
 * @returns {*}
 */
export const getHcpDetail = (param) => {
    return request.get(`/api/v1/schedule/hcp/detail`, param)
}